Margin Collapse

Heading 2

In this example the h1 element has a bottom margin of 50px and the h2 element has a top margin of 20px. So, the vertical margin between h1 and h2 should have been 70px (50px + 20px). However, due to margin collapse, the actual margin ends up being 50px.



Margin Collapse

This is a paragraph.

This is another paragraph.

Here, each p element has a top margin of 30px and a bottom margin of 30px. So, the vertical margin between the p elements should have been 60px (30px + 30px). However, due to margin collapse, the actual margin ends up being 30px.